package io.renren.dao;

import io.renren.common.dao.BaseDao;
import io.renren.entity.AgencyinsuranceregmEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * ${comments}
 *
 * @author Sen 524227263@qq.com
 * @since 1.0.0 2024-05-28
 */
@Mapper
public interface AgencyinsuranceregmDao extends BaseDao<AgencyinsuranceregmEntity> {

    @Select("select GiftPackageName as giftName,1 as num from Agencyinsuranceregm a left join GiftPackageRuleM b ON a.GiftPackageRuleM_FK = b.GiftPackageRuleMOID " +
            "where a.AgencyInsuranceRegMOID =#{agencyInsuranceRegMoId}")
    List<Map<String, Object>> selectGiftCardList(@Param("agencyInsuranceRegMoId") String agencyInsuranceRegMoId);

    @Select("select c.TotalAmount,c.TotalFavorableAmount,c.DeductionAmount,c.Amount from Agencyinsuranceregm a " +
            "left join BusinessM b ON a.AgencyInsuranceRegMOID = b.SettlementM_FK " +
            "left join SettlementM c on b.SettlementM_FK = c.SettlementMOID " +
            "where b.BusinessBillOID =#{agencyInsuranceRegMoId}")
    List<Map<String, Object>> getAgencyinsuranceregmList(@Param("agencyInsuranceRegMoId") String agencyInsuranceRegMoId);
}